﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/MasterPage/Site1.Master" AutoEventWireup="true" CodeBehind="DropZoneManager.aspx.cs" Inherits="TARS.AdminCP.DropZone" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadSkinManager ID="Metro" runat="server" Skin="Hay" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="true" />
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TARSDelivery_EprojectConnectionString %>" SelectCommand="SELECT [ZoneName], [ID] FROM [t_BrachesZone] WHERE ([Active] = @Active) ORDER BY [ZoneName] DESC">
            <SelectParameters>
                <asp:Parameter DefaultValue="true" Name="Active" Type="Boolean" />
            </SelectParameters>
        </asp:SqlDataSource>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <label for="NamesDDL"><b>Filter:</b></label>
        <div style="margin-top: 5px; margin-bottom: 15px;">
            <telerik:RadComboBox Width="250px" DataTextField="ZoneName" DataValueField="ID" EnableLoadOnDemand="True" ID="cboFilterBranchesZone" runat="server" Skin="Metro" AutoPostBack="true" OnSelectedIndexChanged="cboFilterBranchesZone_SelectedIndexChanged"></telerik:RadComboBox>
            <br />
            <telerik:RadComboBox Width="250px" DataTextField="CarrierTypeName" DataValueField="ID" EnableLoadOnDemand="True" ID="cboFilterCarrierTypeName" runat="server" Skin="Metro" AutoPostBack="true" OnSelectedIndexChanged="cboFilterCarrierTypeName_SelectedIndexChanged" Enabled="False"></telerik:RadComboBox>
        </div>
        <telerik:RadGrid ID="RadGrid1" runat="server" EnableLinqExpressions="false"
            AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateEditColumn="True"
            AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
            CellSpacing="0" GridLines="None" Skin="Hay" OnInsertCommand="RadGrid1_InsertCommand" OnItemDataBound="RadGrid1_ItemDataBound"
            OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand">
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
            <MasterTableView AutoGenerateColumns="False" AllowFilteringByColumn="True" TableLayout="Auto"
                DataKeyNames="NewID" CommandItemDisplay="TopAndBottom"
                FilterExpression="([Active] = true)">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>

                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>

                <Columns>
                    <telerik:GridBoundColumn DataField="NewID" EditFormHeaderTextFormat="" FilterControlAltText="Filter NewID column" HeaderText="NewID" UniqueName="NewID" Visible="False">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="ZoneName" AllowFiltering="false" FilterControlAltText="Filter ZoneName column" HeaderText="Branches Zone" UniqueName="ZoneName">
                        <EditItemTemplate>
                            <telerik:RadComboBox runat="server" ID="cboZoneName" EnableLoadOnDemand="True" DataSourceID="SqlDataSource1" DataValueField="ID" DataTextField="ZoneName" AutoPostBack="true" HighlightTemplatedItems="true" Height="140px" Width="220px" DropDownWidth="420px" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="ZoneNameLabel" runat="server" Text='<%# Eval("ZoneName") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="CarrierTypeName" AllowFiltering="false" FilterControlAltText="Filter CarrierTypeName column" HeaderText="Carrier Type" UniqueName="CarrierTypeName">
                        <EditItemTemplate>
                            <telerik:RadComboBox runat="server" ID="cboCarrierType" OnSelectedIndexChanged="RadComboBox2_SelectedIndexChanged" EnableLoadOnDemand="True" AutoPostBack="true" HighlightTemplatedItems="true" Height="140px" Width="220px" DropDownWidth="420px">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="CarrierTypeNameLabel" runat="server" Text='<%# Eval("CarrierTypeName") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="DropZoneName" FilterControlAltText="Filter DropZoneName column" HeaderText="Drop Zone's Name" UniqueName="DropZoneName">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="Active" AutoPostBackOnFilter="true"
                        CurrentFilterFunction="EqualTo" CurrentFilterValue="true"
                        DataType="System.Boolean" FilterControlAltText="Filter Active column" HeaderText="Active" UniqueName="Active">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridDateTimeColumn DataField="CreatedTime" EditFormHeaderTextFormat="" FilterControlAltText="Filter CreatedTime column" HeaderText="Created Time" PickerType="DateTimePicker" UniqueName="CreatedTime">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridDateTimeColumn>
                </Columns>

                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                </EditFormSettings>

                <EditItemStyle BackColor="LimeGreen" />

                <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
            </MasterTableView>

            <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

            <FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>

</asp:Content>
